home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / triton / examples / toolmanager2.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-01-01  |  4.3 KB  |  166 lines

  1. Program ToolManager2;
  2.  
  3. (*
  4.  *  OpenTriton -- A free release of the triton.library source code
  5.  *  Copyright (C) 1993-1998  Stefan Zeiger
  6.  *
  7.  *  This program is free software; you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation; either version 2 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  This program is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with this program; if not, write to the Free Software
  19.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *  Toolmanager2.c - Looks like the ToolManager demo 2 of GUIFront
  22.  *
  23.  *)
  24.  
  25. uses exec, triton, tritonmacros, linklist, vartags, utility;
  26.  
  27. {
  28.    A demo in FPC Pascal using triton.library
  29.  
  30.    nils.sjoholm@mailbox.swipnet.se
  31. }
  32.  
  33.  
  34.  
  35.  
  36. const
  37.      cycle_entries : array [0..7] of pchar = ('Exec','Image','Sound','Menu','Icon','Dock','Access',NIL);
  38.  
  39.      liststrings : array [0..8] of pchar = (
  40.                      '2024view' ,
  41.                      'Add to archive',
  42.                      'Delete',
  43.                      'Edit text',
  44.                      'Env',
  45.                      'Exchange',
  46.                      'Global Help System',
  47.                      'Multiview',
  48.                      'Paint');
  49.  
  50. var
  51.    i : longint;
  52.    LVList : pList;
  53.    MyNode : pFPCNode;
  54.    Triton_App : pTR_App;
  55.  
  56. procedure CleanUp(why : string; err : longint);
  57. begin
  58.    if assigned(Triton_App) then TR_DeleteApp(Triton_App);
  59.    if assigned(LVList) then DestroyList(LVList);
  60.    if why <> '' then writeln(why);
  61.    halt(err);
  62. end;
  63.  
  64. begin
  65.     CreateList(LVList);
  66.     FOR i := 0 TO 8 DO BEGIN
  67.         MyNode := AddNewNode(LVList, liststrings[i]);
  68.     END;
  69.  
  70.     Triton_App := TR_CreateApp(TAGS(
  71.                           TRCA_Name,longstr('ToolManagerGUIDemo2'),
  72.                           TRCA_LongName,longstr('ToolManager GUI demo 2'),
  73.                           TRCA_Info,longstr('Looks like the ToolManager demo 2 of GUIFront'),
  74.                           TAG_END));
  75.     
  76.     if Triton_App = nil then CleanUp('Can''t create application',20);
  77.  
  78.       ProjectStart;
  79.       WindowID(0); WindowPosition(TRWP_MOUSEPOINTER);
  80.       WindowTitle('ToolManager GUI demo 2'); WindowFlags(TRWF_NOSIZEGADGET OR TRWF_NODELZIP OR TRWF_ZIPTOCURRENTPOS);
  81.       WindowBackfillNone;
  82.  
  83.       VertGroupA;
  84.  
  85.         Space;
  86.  
  87.         HorizGroupAC;
  88.           Space;
  89.           TextID('_Object Type',1);
  90.           Space;
  91.           CycleGadget(@cycle_entries,0,1);
  92.           Space;
  93.         EndGroup;
  94.  
  95.         Space;
  96.  
  97.         HorizGroup;
  98.           Space;
  99.           NamedFrameBox('Object List');
  100.             HorizGroupAC;
  101.               Space;
  102.               VertGroupA;
  103.                 Space;
  104.                 ListSSCN(LVList,2,0,0);
  105.                 Space;
  106.               EndGroup;
  107.               Space;
  108.               SetTRTag(TRGR_Vert, TRGR_ALIGN OR TRGR_FIXHORIZ);
  109.                 Space;
  110.                 Button('Top',3);
  111.                 Space;
  112.                 Button('Up',4);
  113.                 Space;
  114.                 Button('Down',5);
  115.                 Space;
  116.                 Button('Bottom',6);
  117.                 Space;
  118.                 Button('So_rt',7);
  119.                 Space;
  120.               EndGroup;
  121.               Space;
  122.             EndGroup;
  123.           Space;
  124.         EndGroup;
  125.  
  126.         Space;
  127.  
  128.         HorizGroupEA;
  129.           Space;
  130.           Button('_New...',8);
  131.           Space;
  132.           Button('_Edit...',9);
  133.           Space;
  134.           Button('Co_py',10);
  135.           Space;
  136.           Button('Remove',11);
  137.           Space;
  138.         EndGroup;
  139.  
  140.         Space;
  141.  
  142.         HorizGroupEA;
  143.           Space;
  144.           Button('_Save',12);
  145.           Space;
  146.           Button('_Use',13);
  147.           Space;
  148.           Button('_Test',14);
  149.           Space;
  150.           Button('_Cancel',15);
  151.           Space;
  152.         EndGroup;
  153.  
  154.         Space;
  155.  
  156.       EndGroup;
  157.  
  158.       EndProject;                       
  159.    
  160.  
  161.     i := TR_AutoRequest(Triton_App,NIL,@tritontags);
  162.     CleanUp('',0);
  163. end.
  164.  
  165.  
  166.